Add unit update

Updated code to include suggestions from comments from last PR