changed size() to top()