Added some more utility functions
Added a framework for geometric primitives
Added a safety line to avoid NPE