code worked