Works okay, but errors need work