changes to difference main and other functions