Prepared removing the main function and unnecessairy arguments
fixed formatting
fixed compile errors..