for else loop doesnt actually work - replaced with if statement to protect from over 0 division
updated assignments/index view because for else statment doesnt actually work