change size to val instead of var