added bash for ease; added logging; optimized file operations; etc