set up 3 constructor functions,setting up event listener functions