Redid JS from scratch