Refactored to have unit inherit, and it works!