cleaned up code and added messages