added index, slightly modified things.