Seems to work

Needs testing though