Added chinese remainder theorem