added code to generate normals