add comments and resize(int,int) helper function