Replace pow() with multiplikation to improve speed