Everything looks fine to me, I am assuming that rectArea is a global variable? Also is that defined as a double? Are you definately passing in the data you should be to this method?