General layout and algorithm found

Just need to code it now (hehe, just...)