fixed q 1-4 to work on html,made javascript a separate file