Script tidy and changes to index