Copied original hw1 code over