working on fixing some bugs, will re-write js