Full Localization

finished up the localization function