refactored trainBananas