Add alhpa and beta functions. Still runs way too slow...