Added new loss/code mechanics