Added specs and more utility functions.