I don't quite understand what's going on here. A one-liner for each of the cases might help.