fixed styling, simplify algorithm, custom server