Fixed editor showing for complete essays bug + cleaned up code