Perfected some functions and variables for further versatility