implemented norm function