calcCOM() bug fixed