Criteria

Added prototype version of criteria handling