renamed count to countr for cross library compatability