added associations and changed index page to use them