better printing of moving flag and bug fixes