final with comments and changed client.js and finalize UI v3