start of 'if' parsing logic