Algorithm formatting