added a function
take 2.3