Tweaking Q code again