Minor refactor
Write autols function