complete calcArea function