initial java script version