updated, this is the simplest I could come up with