finally got somwhere with first part of ML