re-structured php
javascripts added