few small changes
initial writing of normal estimation routine