re-started in C because Pascal isn't as fun.