Wrote apply_styles function