modifications to filltree code
fill q as double