Made main.c more generic.