added a comment to magic number
some fixes after rebase