implement basic mpq