Adds error handling and conforms to acceptable styles