Updated main

Some partial changes to main. Still does not run.