New iteration, mimicng the JS verison more closly