Corrected some mistakes, added main