added when and unless and some test cases