Updated resilience to input of white spaces. Renamed variables.