fixed function to include absolute value call (was missing, leading to negative areas)