First iteration of prog 2