first version with ANN, sort of working