Addition of 'prev' pointer

Also, popfront and popback have been changed into void functions.