Finally wrote the improper to proper fraction function