Failed attempt with by function