replaced toolbox.norm by toolbox.dist