Added javascript canvas version