final commit before presentation. js refractored