Another attempt at ud.py

still not 100%.