Added variable total

Added variable total