Added backwards navigation code, still buggy though