Validate top function with more elements in stack