Renamed writeBlock to writeLine
Added unit tests around writeLine