Added top() function