spruced up some code