implemented localize rungs using class to avoid global variables