full implementation of norm