rt rewritten to clean up how cells are handled