added small changes and tests