added getFirst and getLast methods to list