implementation of if