Finalized
simplified some code, added underflow protection
Added an implementation for a resizing array
Implementing array shrinking - it is not working yet