Changed all pows to actual multiplication.