Rewrite function for IC 18, 19, deleted first implementations