revised some codes