Added optimilisations
Added map