Reworked to run all functions at once, and allow cascading styles to overwrite