Add function support in conditions

Fix issue #1