Parsing total to int before performing operation and enhanced documentation