buggy beta algo implementation complete (with out beacon)