Naive but working verssion