Alternative implementation

This pull request builds off the previous and also includes an alternative implementation.