Final version for HW submission.