could this function be used in the post I published below? I tried using same function but it did not come out as planned.