Optimzed Syntax

replaced spaces with tab characters
used more correct usage of += and -=
ensured that remainder does not get added to all stats if it is depleted.