Cleaned up code and added some groups