test without segfault, still not sure if using his code correctly