norm by index function implemented and tested, returns inf on divide by zero