added custom macros and adjusted some things