got rid of angular and started switch of PHP code to Javascript