Added a clipping function, corrected embed call when decode should've been called