Medieval and Islamic refinements Critiques and elaborations of the Ptolemaic and Aristotelian systems