removed source.txt and simplified an if-else statement