changed size variable to be SIZE_T