adding the beginning of instruction functions, modifying the main function