80% main.c, there will be a cluster fuck after this