Moved maxbul Code with other globals