added globals
added buffer for normal vectors