Project 2, problem 1: Extract entry function