Changing code to 2.7