lw variable is used everywhere except here
lowercase x and y are defined (same object), but only x is used. substituting to y makes more sense; minor whitespace edits