Refactored the code. Fixed the worksheet_17.java