Gets function returning function working