Changed code to make it easier for the filehandling.py code.