fixing refrences and constants