blend function written