Javascript implementation yay also clarifications