Adjusted indentation, added (few) comments.
Custom error message.