changed some lines to make the program be more backwardcompatible