Modified the prob method, added in some helper methods