changed some peek and pop operations