Add guards and more docs