Changed basic structure of program to make correction on data possible