it seems to be working. Need to tweak i/o a bit