Implemented the updates from #49 and @Globegitter