The algorithm *should* work now. Next up - actually rendering stuff!