wrote the same code twice