rebase take 2

please review this code