Finished writing the code

Still fixing warnings and havn't ran main yet.