getting rid of unused total variable