initial implementaion of localization