fixed and improved isSublist