first functional version

[Zero robustness] Works only under ideal conditions.
Additional styling pending.