fix and normalize errors
add option to use predefined sampling C