Added processCode method