Added map with required functionality but which gives errors