Replaced pow function by bitwise shift.