Variables moved outside method.
nextBlock() implemented