convert the rest of the code