mini-dinstall written from scratch