cleaned up codes for submission