added some error stuff, not sure how to do remove_padd() without iterators in linux