tolerance can be set as an option, plus custom classes. fix #3