write the code