cleaned up train example for blog post