The pull request with all the code.

view logic, get that stuff in a helper.