MLP implementation