Add commenting, reorder variables to make things a bit more clear.
Update readme to include a description of the design process.