Got rid of useless fields, added some naive algo.