combining code part 1