accessed variables incorrectly