organized program into methods in class