Added state save. Validation for new boxes. Other small changes