working from ref