finished the ir conversion and check function