added implementation of if parser