Merge with samyonair's version