Rewrote studview_unit and tweaked other files