bazillion bug fixes
cleaning up logic