fixed question1 and made a php version