Fix/issue/70

Updated fix for issue #70, add unit test remove if/else bug.