createDOM common code moved to calculations.js