improved JS to display one card at a time