added move debug logging, added move optimization