added getblockat function