Optimize pow(2,x) by using (1<<x).