Sped up calculations, added pc correction