new algorim and UI