Second functional draft

Fixed the bug which caused the result to trim three digits off each time
user hit submit.