moved graphics code to graphics class, and added public method declarations