I get a segfault on line 45, any ideas why?