Finished implementation, but isn't quite working.