js is gross but it works and js is always gross so ok