added ability to define conditions for a method