code with naval pattern part 1