altered parser to handle AND/OR for the functions properly