change the matching condition x
include few new improvments