reverted Main.c back to original state. added comments