added overlap checking