First checkin of optimap code