Big rewrite to allow user to pick variables for x, y