Implemented Array for shapes, redraw, undo and redo functions