Updated code. Still lacking memory management. Darn. And its slow as fuck. Fuck.