modified some code.