removed crappy functions. runs a bit better but still segfaulting now.