CODE: unified normal calculation