separated out model view and controller code

fixed it!