reorder.
indenting.
Don't put backup files in PWD.
fix bash syntax.