Changed package name
Hooleanised (optimised code from when I wrote it ages ago)