Added the core function