fixed up bugs in prototype of backup routine. moved to use path sep so
that it will be portble to Linux and mac.