Added -p to preserve file attributes when moving files

Also fixed a few formatting problems.