working on sub-routine