preliminary luby's algorithm working/tested