add unit tests and swap function
add weight unit
improvements code
Merge pull request #4 from raudinC/dev

add unit tests and swap function