takes callbacks as parameters