n-back implementation in python and javascript.