cleanup and subs working