small d function