enhanced rept.js and homepage function js