Adding scala version of rec engine