changed run time of push from O(n) to O(1)