finished documenting train()