renamed variables, stripped unneeded code