added wedge function