cleaning up indentation and adding preventDefault for single click