Cleaned up gross code