added button with basic functionality and cleaned up javascript