Completed main algorithm, but very slow
Main algo working. removed Decimal