now we need method to check whether an alien is at either edgeand we need to modify update(to allow each alien to move in the appropriate directionalien py def check_edges(self)"""return true if alien is at edge of screen ""screen_rect self screen get_rect(if self rect right >screen_rect rightreturn true elif self rect left < return true def update(self)"""move the alien right or left ""self +(self ai_settings alien_speed_factor self ai_settings fleet_directionself rect self we can call the new method check_edges(on any alien to see if it' at the left or right edge the alien is at the right edge if the right attribute of its rect is greater than or equal to the right attribute of the screen' rect it' at the left edge if its left value is less than or equal to we modify the method update(to allow motion to the left or right by multiplying the alien' speed factor by the value of fleet_direction if fleet_direction is the value of alien_speed_factor will be added to the alien' current positionmoving the alien to the rightif fleet_direction is - the value will be subtracted from the alien' positionmoving the alien to the left dropping the fleet and changing direction when an alien reaches the edgethe entire fleet needs to drop down and change direction we therefore need to make some substantial changes in game_functions py because that' where we check to see if any aliens are at the left or right edge we'll make this happen by writing the functions check_fleet_edges(and change_fleet_direction()and then modifying update_aliens()game_ functions py def check_fleet_edges(ai_settingsaliens)"""respond appropriately if any aliens have reached an edge "" for alien in aliens sprites()if alien check_edges()change_fleet_direction(ai_settingsaliensbreak