Added function isPower2 + comments