moved deselect button to bottom bar; moved js code to js file; cleaned up code