Segmentation fault fixed, still a bit wierded out by it, I don't quite know how it happened