updated version of scrounge.js