Conditional Assignment

Final edits to make all code work