replace perl with sed
remove xargs usage
stop popd and pushd printing to terminal
fix mistake made by removing directory check
dynamically define ${TOP_DIR} instead of hard coding it
fix errors caused by refactoring other scripts