formatted code for Joe