Logic for both examples is as close as possible - <Mojo>