working mips code