use raf
get rid of some console.logs