Taking Nick's code and merging it with my UI.