Added a validate function, reordered syntax, made sure error messages gave more direction to the users and integrated validate function in other functions.