implemented the reclass function