added if/else framework