alternative way of writing, need to test speed