Another attempt at getting keys as desired