updated main.c

Still lots of bugs but fixed it to the best of our abilities