condenced code, more generic variable names