@Override
    public String viewModule(String modCode) {
        String result;
        moduleEntity = lookupModuleFromCode(modCode);
        if (moduleEntity == null) {
            return "Module not found!\n";
        } else {
            result = "Title: " + moduleEntity.getModuleTitle() + "\n";
            result = result + "Lecturer: " + moduleEntity.getLecturer().getTitle() + " "
                    + moduleEntity.getLecturer().getName() + "\n";
            result = result + "Time: " + moduleEntity.getTime() + "\n";
            result = result + "Venue " + moduleEntity.getVenue() + "\n";
            result = result + "Synopsis: " + moduleEntity.getSynopsis().getContent() + "\n";
            result = result + "Registered Students: \n";
            Set<StudentEntity> students = moduleEntity.getStudents();
            if (students.isEmpty()) {
                result = result + "No registered students!";
            }
            for (StudentEntity student : students) {
                result = result + student.getMatricNumber() + " " + student.getName() + " " + student.getEmail() + "\n";
            }
            return result;
        }
    }