Changed Roi analysis and fixed contact detection