Making the stack able to tell max and min in a O(1) time for every level and cleaned up comments etc