getting a segfault on line 32