Improved comments, added (minimal) tests