More work on imap