moved inv to header
remove use of .size()