Initial commit
Works fine with reasonable values
NOT tested with the edging cases
Merge branch 'remotes/github_webog/master'