Adding existent scala code. Expander has already been completed.