Modification by Mayank to deal with some kind of corner case.
Merge branch 'master' of github.com:kristinbranson/JAABA