Minor updates. Write-before-read error fixed.