Semi working return function