function for calculating the area