findleftupper now uses np.where
changed varnames to varNames
split defs to separate file