semi-functional
dec returns buffer