Add spec for function