Adding tests and improving the usage