algorithm quick and dirty writing done; evaluation part is on the way