added overlap code