implemented base logic