modified 2&3.js