small code changes and extras