For cs251 project