Added config file and changed index to accept config