changing outputElement to $('#output')