condensed if statements in insertLast()