modified LAB1.cpp. Labeled window