Added some function hackery and button magic.