Add comment. Clean up code.
Refactor calculate current status to helper function.
Add comments. Clean up code.