fixed some var names and readability