added comments and fixed critical error

finally fixed that critical error with no "scan.nextLine"