Highly non-finished code. Be warned.