Updated with functions for inverses