First pass on Miller's algorithm