started out to implement proper tail calls