Added the normal detection part