Fix bug when playing single file
Refactoring software to a more pythonic version