converting activities to scala