Changed ui.js to use Object.size()