many different adjustments added, tests added and refactored