wrote tests for assign_lonely_zeros, refactoring to make tests pass