changed over spCountSamp function to follow purely IPP logic