Going to bed now, will work on the strcpy segfault tomorrow