Simplified Logic

and added some helpers and whatnot.