Indentation and error handling

Changed indentation and added error handling to the float conversion