added implementation of if