Some initial functionality and tests
Add check for negative weight