Stack implementation with currentMax working