Created a macro to neaten up the code.