better code but do the same