Patch 1

and here's the merge