changed code implementation