Typescript type errors fixed by refereing to MDN.
Y offset is now fixed to the initial difference. (each function starts from the origin dicounting for constants)