Added some documentation, cleaned up the interface