Resolve #1 Add tests