some comments to clarify usage and removed some "magic" numbers