need to verify calculate algo