fixed some var names and spacing