created separate file the core functionlity