added a function, incomplete.