rewrote silly levdist program