Fixed compilation errors - Program now fully runs