Even as a random by-walker I see few bugs in your code [ rot rot ] is same as [] [ dup * ] is square function -- likely not what you want [ 1 + = ] pops two items -- ditto