Finally got core functions working