made size function to assist in sorting