changed code in sub