moved references to end