open-source code by Raghda Al-Shaikhli