trying to solve sum