cleaned up the messy script ;-)