Rewrote js completely