Fixing bugs with overlap detection
messed up merge