Seems to be working, no way to tell if it is correct though