basic version
works fine but returns wrong..