Added transition to CSS, added closure to JS