improved code based on suggestions
eagle complete