Implemented more advanced shape functions.