How I can make this program better?