I am sorry if I sounding blunt, because I'm a little irritated with my own code right now, but I'll offer you this advice. Search the AUM's, they have most of the code your looking for similar to what you want. George is a great guy, take a look what he has given to the community. He explains things like c_scan, c_move, ect. at length, I simply don't remember which of the AUM's do this.