first iteration of ma sum solve :3