Adding tests. Resolved #3