Debugged for low value inputs