variable names rewritten to be more general