v1.01
Took care of NULL cases
Exits on underflow and overflow
No need of this alternate implementation
v0.10