working.  fails on null input.  tip needs better formatting.