Added WriteBlock function