fix const correctness
stack top implemented