Added recrusive methods in if/else