changed private to local vars