replaced pown function, because it couldn't compile on intel iris.