rewrote whole thing in node, added then added changes to make it better. works perfectly now!