simplified function
corrected 2 power 10 as 2048