variant without dicts (only for testing)