Added if statements

Added if statements to make FIRST and LAST links.  As well as making
sure there is at least four links to pages before the LAST page.