Finished map code
Added threading