Core js file - updated

Added additional options and improved the code