parameters work, adding range check where needed