remainder; type; fix bugs