updated the implementation of unit object