about to flip mode labelling upside-down
done
about to convert lists to numpy arrays
working on optimization