update basic functions and tested, stack implemented in array