this is now working but still not doing what it should