cast result of pow to int to stop compiler complaining