added some time measuring to see which version works better