Error handling, create polynomial and return types