Added support for MB and GB units

Pull request #178 - simplified code.