implement more functions
fix map function