Made grid mixin more flexible