CS247 assignment 3