modified some codes