enable parallel comput. punishment term should be implemented later