significant update; improved documentation, new methods, use of id