first try at writing an efficient and "correct" exp10