adding event remove angular and moving some JS around