Initial prototype built from emil10001's example.