Adapt PHS to coding style.
Use 256 cols when in PHS mode.
Update algorithm to latest spec.