added map funcs, slight redesign