changed sub-routine