How this program works...