maybeint implementation