changed things around and simplified them a bit