Cleaned up code and license