compiles first half of mlpTrain. still a work in progress