trimming up some code