some commenting and cosmetics in downsample.cpp