Refactored Javascript. Added course overriding.