use functions instead of many variables