cleans up inverse