Complete re-work

New version by Torb