Added missing @Input annotations. Updated some comments. Fixed a typo in a field name. Restructured some code.