Add dependencies and update Readme.
Remove unused code.
Refactor to named functions.