added solution check method and tests