Speed up JS version