Cleaned up the code - Yash