Update agent binary state algo

resolves #7