simplied code in preparation for adding offset argument