cleanup and give better names to variables