First semi-working revision

Something seems to be wrong with soultion scoring, but otherwise it runs