fixed index
cleaned up script