Rewrote the support material function