Add distance function to math
Add withChance function to math
rewrite countStructList to use reduce.
Fix whitespace