solved this one, changed a lot from my initial approach