Starting writing test routines, added a couple of fd functions