walk by coolaj86, plus convenience functions.