added code to index and scripts