added constants.js
added ready function