Implement custom compilation rules

Edited by Sarah German