fixing variables errors
minor style changes