simplifying ramps code