fixes return variants and documentation