Cleanup, added Ahmed's version