An algorithm for the traceability of farm field activities