Code for unit 6