added output existence checking to all implemented functions