fixed up and now working