function stated for first sub assignment.