added comments and modified index