this is a better version in it with logs.