organized the code into classes