Really improved the code, program exactly as useful as before