Modified the methods to take in size parameter