just make everything in map instead of appending gradually