Finally fixed hw3