Converted plain js to typescript. (2nd live sitting)