modified some code