updated button functionality
updated javascript