error handling, code formatting