code in master semester 1