Special Thanks to Jacob Davenport for IPhone version inspiration and BoardGameTools for their windows version with code.
Special Thanks to Maximilian Kalus for Java version that is the new basis for the algorithm.