Few changes and first part of tests added.