public String commandTOP(String arguments) {
        // Splits the input down to the message number and number of lines.
        String[] argSplit = (arguments + " ").split(" ", 2); 
        String msgs = (argSplit[0].toUpperCase()).trim();
        String ns = (argSplit[1]).trim(); 
        int msg = convertStrToInt(msgs); if(msg == -1) {return createERR("no such message TOP " + arguments);} 
        int n = convertStrToInt(ns); if(n == -1){ return createERR("please enter a valid line number TOP " + arguments);}
        
        if(idb.isMessageMarked(idb.getiMailIDFromRow(msg - 1))) {return createERR("Msg deleted. TOP " + arguments);}
        
        String[] messages = idb.getMailMessages();
        String output = createOK("TOP " + arguments);
        
        if(msg == 0 || msg > messages.length) { return createERR("no such message, only " + messages.length + " messages in maildrop TOP " + arguments);}        
        
        String[] msgHeadersSplit = messages[msg - 1].split(CRLF + CRLF, 2);
        String[] msgHeaders = msgHeadersSplit[0].split(CRLF);
        String[] messageWithoutHeader = msgHeadersSplit[1].split(CRLF , n + 1);
        for (int i = 0; i < msgHeaders.length &&  i < 10; i++) {
			output += (msgHeaders[i] + CRLF);
		}
        output += (CRLF + CRLF);
        for (int i = 0; i < messageWithoutHeader.length - 1; i++) {
            output += ( messageWithoutHeader[i] + CRLF);
        }
        return output + "." + CRLF;
    }