added more code to gameoop.js