Changed mag() to use dot() - now DRY