code with df for all conditions and final results

Don't pull request with code that doesn't work. Or at least I assume it doesn't from your comments.