add checks for elements larger than capacity and account for the size of element being added