Akshay's Updated Code