modified index.sh for memory