implementation of last but one element of a list