Old Java Code for future reference