Added stop calculation using matricies. Backend works but needs GUI update.