rewrote the script in node + angular, added routing