function harvest(address farmer) internal {
        
        recycle(farmer);

        
        var list = fields[farmer];
        for (uint i = empties[farmer]; i < list.length; i++) {
            var elapsed = block.timestamp - list[i].sowed;
            if (elapsed >= growth) {
                if (elapsed - growth < decay) {
                    var harvested = (2 * list[i].potatoes * (decay-elapsed+growth) + decay-1) / decay;
                    var rotten    = 2 * list[i].potatoes - harvested;

                    cellars[farmer] += harvested;
                    Transfer(this, farmer, harvested);

                    if (rotten > 0) {
                        trashes[farmer] += rotten;
                        Transfer(this, 0, rotten);
                    }
                } else {
                    trashes[farmer] += 2 * list[i].potatoes;
                    Transfer(this, 0, 2 * list[i].potatoes);
                }
                empties[farmer]++;
            }
        }
        
        if (empties[farmer] > 0 && empties[farmer] == list.length) {
            delete empties[farmer];
            delete fields[farmer];
        }
    }