Modifications to make the program work