Renaming some vars / functions. Updated tests