Cleaned up code further.