made the naive version work