some algorithms in java and old f# something