A few changes that i had to do to make the program works well