massive clean up and magic shoppe finished. Map function