Changed p to very slow but accurate version