working version of HW2 -2: changed calc