Cleaned up code and exported final version