added candidate state logic, misc tweaks
WIP