added comments and fixed index error
fixed merge conflicts
rm'd old script