corrected the errors
corrected spacing issues and naming
string computation improved