cleaned up code and fixed error when sending blank input