Still searching for a better code