changed the algorithm to adhere with Fibonacci sequence