Add fastmap function
Returns appropriate error codes