Functions I made for Mat Lab