changed area function, seems that the zero area bug is fixed