move javascript to its own file, go crazy math up in here