Small logic changes, output final image