Came up with a slightly better solution to minimizing scalar products... still not good enough.