moved cross and normal functions into the header file