Changed function names, added getHead and getTail functions.