Add 3d environment math stuff
Improve chat helper