			<div id="comments">
<?php
	$grain_req = get_option('require_name_email'); // Checks if fields are required.
if ( post_password_required() ):
?>
				<div class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'grain') ?></div>
			</div><!-- .comments -->
<?php
		return;
	endif;

?>

<?php if ( have_comments() ) : ?>

<?php /* numbers of pings and comments */
$grain_ping_count = $grain_comment_count = 0;
foreach ( $comments as $comment )
	get_comment_type() == "comment" ? ++$grain_comment_count : ++$grain_ping_count;
?>

<?php if ( ! empty($comments_by_type['comment']) ) : ?>

				<div id="comments-list" class="comments">
					<h3><?php printf($grain_comment_count > 1 ? __('<span>%d</span> Comments', 'grain') : __('<span>One</span> Comment', 'grain'), $grain_comment_count) ?></h3>
					
<?php $grain_total_pages = get_comment_pages_count(); if ( $grain_total_pages > 1 ) : ?>					
					<div id="comments-nav-above" class="comments-navigation">
								<div class="paginated-comments-links"><?php paginate_comments_links(); ?></div>
					</div><!-- #comments-nav-above -->					
<?php endif; ?>					
				
					<ol>
<?php wp_list_comments(array('style' => 'ol')); ?>
					</ol>

<?php $grain_total_pages = get_comment_pages_count(); if ( $grain_total_pages > 1 ) : ?>					
	  			<div id="comments-nav-below" class="comments-navigation">
						<div class="paginated-comments-links"><?php paginate_comments_links(); ?></div>
	        </div><!-- #comments-nav-below -->
<?php endif; ?>					
					
				</div><!-- #comments-list .comments -->

<?php endif; /* if ( $grain_comment_count ) */ ?>

<?php if ( ! empty($comments_by_type['pings']) ) : ?>

				<div id="trackbacks-list" class="comments">
					<h3><?php printf($grain_ping_count > 1 ? __('<span>%d</span> Trackbacks', 'grain') : __('<span>One</span> Trackback', 'grain'), $grain_ping_count) ?></h3>
					
					<ol>
<?php wp_list_comments('type=pings&callback=grain_custom_pings'); ?>
					</ol>				
					
				</div><!-- #trackbacks-list .comments -->			


<?php endif /* if ( $grain_ping_count ) */ ?>
<?php endif /* if ( $comments ) */ ?>


					<div class="formcontainer">	
			<?php		
		if ( ! comments_open() && ! is_page() ) :
		?>
		<p class="nocomments"><?php _e( 'Comments are closed.', 'grain' ); ?></p>
		<?php endif; // end ! comments_open() ?>
	<?php comment_form(); ?>
										
					</div><!-- .formcontainer -->



			</div><!-- #comments -->
