Reindented RATTIC function