Copied the button example to get an idea of how it all works.