changed code and deleted echo statements