Initial version of Javascript version