created functions per prog asgmt 2 instructions