modified for simpler interface