random block

added the random block (cos it's my fav) and got NewBlock to return an error if necessary. I don't know why Nik's commits are in this pull request.