getting closer. segfault city though :'(