basic logic of program