fixes to 1d and 1e, use hashmap instead of array