Absolute crappy code. need to do more.