Pregunta de entrevista de Cow Protocol

Refactor and debug code, then do a review