first working solution with 10-15% miss rate