Clean up nadaraya watson estimation code.