Copied over updated source from Crystal