add type information
use ** operator instead of Math.pow