tested and now working