Started to rewrite from scratch... The old code was raw and dirty written.