Bugfix after testing of algorithm on phone