added conditions working on if ifelse
added conditions
merging
fix merge stuff