Cleaned up code and new feature