completed practical 3 and 4 except display_pattern