Cleaned up code and comment