Merge pull request #1 from skanwal/max

new changes after forking