Added code to implement Criterion classes and process options correctly