Formatted the code and added the base MouseListener class.