segfault gone, but results aren't what they should be