Added custom implementations of map and filter