switched to a more simplistic implementation