minor improvements, including better selection of gaussian kernel's epsilon