bit of tyding up and implemented native methods