Fixed wearing bag. Added some junit tests