Replaced std::pow with shift since clang doesn't like int as a first argument
(reports that call is ambiguous)