made more like class code