fixed
added GPL statement
merged
Tweaked javaLogic() to be more efficient and earn more money