made code more concise
noted that sh should be run from subdir