input ribbons

replace original code