add double variant and make some length checks