added train() to mlp