Cleaned up code, marked areas that can be removed when fully converted, and commented main function