Problem 1 solved in MIPS assembly