Private Spire Implementation, some fixed errors and  math added