Converted from TypeScript to JavaScript
Closed #2