small changes and a new function....