improved calculation and added pow to the syntax