Patch 1

main.c is not finished yet, commented out a line that currently causes a segfault.