homework3 without NPE