#14 - Rewritten code so Tomek can run it on linux ;)