fixed bug in stack class, had to re-do it