use proper var names and typo fix