Fix some css conflicts; wrap code in function