some small changes and tests written