FIX: calculation performed avoiding stupid double loop + comment