adapted by emre