Missing comments.
Fixed improper formatting.
Fixed function parameter naming.
Fixed an improper initialization order.