implemented flag control and first version of listener call for homography