Pagination not quite working

My pagination isn’t quite working. there are only 4 events and pagination is set to 3 per page. when i load the second page it loads the first event again on it’s own instead of the the last post.

My code is below. I used the kirby docs pagination structure. I’m pretty sure it’s not working because of the loop inside of my events loop but i have no idea how to correct it.

<div id="main-container">
    	<div class="content">
        	<div class="container">
            	<div class="row">
                	<div class="col-md-12 content-block">
                        <ul class="events-list">
                        <?php $events = $page->children()->paginate(3);
                            $i = -1;
                            foreach($events as $event) {
                                $i++; ?>
                                <li class="event-list-item">
                                    <?php $calendar = page('events')->children()->nth($i)->calendar()->yaml();
                                        foreach($calendar as $calendarEntry) { ?>
                                                <span class="event-date">
                                                    <span class="date">
                                                            echo date('j',$eventday);  
                                                    <span class="month">
                                                            echo date('M',$eventmonth);  
                                                    <span class="year">
                                                            echo date('Y',$eventmonth);  
                                                <div class="event-list-cont">
                                                    <span class="meta-data">Starts:
                                                        <?php $eventday=strtotime($calendarEntry['_begin_date']);
                                                        echo date('l',$eventday);  ?>, 
                                                        <?php $eventstarttime=strtotime($calendarEntry['_begin_time']);
                                                        echo date('g:i A',$eventstarttime); $eventday=strtotime($calendarEntry['_end_date']);
                                                        if ($eventday){ ?>
                                                            | Finishes: <?php echo date('l',$eventday); ?>,
                                                            <?php }  ?>
                                                        <?php $eventendtime=strtotime($calendarEntry['_end_time']);
                                                        if($eventendtime) {
                                                            echo date('g:i A',$eventendtime);
                                                            }  ?></span>
                                                    <h4 class="post-title"><a href="<?php echo page('events')->children()->nth($i)->url(); ?>"><?php echo $calendarEntry['eventname'] ?></a></h4>
                                                        <?php echo page('events')->children()->nth($i)->eventwriteup()->excerpt(250); ?> <a href="<?php echo page('events')->children()->nth($i)->url(); ?>">read&nbsp;more&nbsp;→</a>
<!--                                                     <a href="#" class="btn btn-default">Book Tickets</a> -->
                                    <?php } ?>

                            <?php } ?>
                        <!-- Page Pagination -->

                        $list       = $page->children()->paginate(3);
                        $pagination = $list->pagination();


                            <ul class="pagination pagination-lg">

                                <?php if($pagination->hasPrevPage()): ?>
                                    <a href="<?php echo $pagination->prevPageURL() ?>">&larr;</a></li>
                                    <?php else: ?>
                                    <?php endif ?>
                                <?php foreach($pagination->range(10) as $r): ?>
                                    <li><a<?php if($pagination->page() == $r) echo ' class="active"' ?> href="<?php echo $pagination->pageURL($r) ?>"><?php echo $r ?></a></li>
                                <?php endforeach ?>

                                <?php if($pagination->hasNextPage()): ?>
                                <li class="last"><a href="<?php echo $pagination->nextPageURL() ?>">&rarr;</a></li>
                                <?php else: ?>
                                <li class="last"><span>&rarr;</span></li>
                                <?php endif ?>
                        </nav> ....

Just for reference: The solution for this is in this topic in case someone else has a similar problem.