further development on fast.java. @todo still needs debugging
fixed fast algo.