Made changes to made the code work