This is a submitable version of the code