Cleaned up code and added new settings