made javascript version