reorganized and added a shell script for more convenient use