Some minor changes

improving some functions