Added then, try JS snippets. Minor changes.
Added class snippet.