Initial import

- Initial import with 2 bugs requiring fixing