first implementation of program