Fixed up main.c. Updated to most recent libraries.