Cleaned up a bit and made sure beta calculation was correct.