a bit better version but still much to improve